import React, { PureComponent } from 'react';

import { connect } from 'umi';
// import moment from 'moment';
import { Card, DatePicker, Table, Form, Button } from 'antd';
// import { get as _get } from 'object-path';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './List.less';

@Form.create()
@connect(({ attendanceMineList, loading }) => ({
    attendanceMineList,
    loading: loading.models.attendanceMineList
}))
class OvertimeDetail extends PureComponent {
    state = {
        columns: [
            {
                title: ' 日期',
                dataIndex: 'data',
                key: 'data'
            },
            {
                title: '签到时间',
                dataIndex: 'signInTime',
                key: 'signInTime'
            },
            {
                title: '签到状态',
                dataIndex: 'signInType',
                key: 'signInType'
            },
            {
                title: '签退时间',
                dataIndex: 'signBackTime',
                key: 'signBackTime'
            },
            {
                title: '签退状态',
                dataIndex: 'signBackType',
                key: 'signBackType'
            }
        ]
    };

    componentDidMount() {}

    render() {
        const {
            form: { getFieldDecorator }
        } = this.props;
        const { columns } = this.state;
        const {
            attendanceMineList: { attendanceSource }
        } = this.props;
        return (
            <PageHeaderWrapper>
                <Form layout="inline" className={styles.form}>
                    <Form.Item label="考勤月">{getFieldDecorator('start')(<DatePicker />)}</Form.Item>
                    <Form.Item>
                        <Button type="primary">搜索</Button>
                    </Form.Item>
                    <Form.Item>
                        <Button type="primary">导出</Button>
                    </Form.Item>
                </Form>
                <Card>
                    <Table dataSource={attendanceSource} columns={columns} />
                </Card>
            </PageHeaderWrapper>
        );
    }
}

export default OvertimeDetail;
